-- curse_magic
-- created by zhuangsl
-- 诅咒术

return {
    fetchProps = function(who, status, condition)
        local props  = {};
        local propId = PropM.getPropId("reduce_attrib2");
        local value  = tonumber(condition["value"]);
        local endRound = condition["end_round"];

        if value > 0 then
            table.insert(props, { propId, "attack", value, endRound, });
        end
        
        -- 同时降低血量
        value = tonumber(condition["hp"]);
        if value > 0 then
            propId = PropM.getPropId("curse_reduce_hp");
            table.insert(props, { propId, "debuff", value, endRound, });
        end

        return props;
    end,

    desc = function(who, status, condition)
        -- 获取状态描述
        local cfg = CombatStatusM.getStatusInfo(status);
        local desc = cfg.desc;

        -- 天赋额外效果
        local value  = tonumber(condition["hp"]);
        if value > 0 then
            desc = cfg.extra_desc;
            desc = string.gsub(desc, "{append}", value);
        end

        -- 效果
        value = condition["value"];
        desc = string.gsub(desc, "{value}", value);

        return desc;
    end,
};
